import { connect } from 'react-redux'

/* import {
  addUser
} from '../../store/actions/userAction' */

import * as userAction from '../../store/actions/userAction'

// 把reducer中的state映射到当前组件的props中
const mapStateToProps = state => ({
  users: state.getIn(['user','users'])
})

/* const mapDispatchToProps = dispatch => ({
  addUserCmp(data){
    dispatch(addUser(data))
  }
})

export default connect(mapStateToProps, mapDispatchToProps) */

const mapDispatchToProps = dispatch => ({
  addUserCmp(data){
    dispatch(addUser(data))
  }
})

export default connect(mapStateToProps, userAction)